import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import plugins from './plugins' // plugins

//引入全局方法
import {
	globalfun
} from './common/fun.js'
Object.keys(globalfun).forEach(key =>
	Vue.prototype['$' + key] = globalfun[key]
)
// 定义全局自定义过滤器
import {
	filters
} from './common/filters.js'
Object.keys(filters).forEach(key => {
	Vue.filter(key, filters[key])
})
// 引入防抖节流函数文件
import {
	throttling,
	chattering
} from './common/cont.js'
// // 在Vue实例上扩展全局方法
Vue.prototype.$throttling = throttling;
Vue.prototype.$chattering = chattering;


Vue.prototype.$numToLocaleString = (num) => {
	if (!num) return '0'
	let parts = num.toString().split(".");
	parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
	return parts.join(".");
}

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
Vue.use(plugins)
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif